W32Dasm Disassembled v1.01 1/2001 written by Harlequin




Update version 1.01a

Fixed cursor and pgup/pgdn key operation. They are now once again detected and 
function correctly in W32Dasm




Update version 1.01
_____________
Win 2K Users:

It was reported to me that the patch did not work on win 2k due to the CommandLine function being incompatible. I do not have Win 2K (and I don't for one minute think I will be getting it, if you are going to struggle with a new operating system why the hell not make the leap to Linux??) so I cannot test or work on this problem.
So as an alternative I have given several options in the patcher. You can now choose to install various combinations of functions. This was not an easy task to achieve believe me, it was damm near easier to write the bloody functions in the first place, mayby I should write an essay on the patcher :-)

So if you have Win 2K try not installing the 'Commandline n Recent' option.

If you choose to install the 'Commandline n Recent' function then you must also install the 'Permemnant Patcher' function. This is due to the size increases in the resource section and is to complicated to get round for me to be bothered. The patcher will not allow you to deselect the 'Permenant Patcher' option while you have the 'Commandline n Recent' option selected. Also if you select 'Commandline n Recent', 'Permemnant Patcher' will be auto selected.


__________________
DREADs SDR Enabler

It was also requested that I make Dreads SDR enabler optional as apparently when installed it does not allow the correct disassembly of some none VB programs, especially Delphi programs.
I do not work with VB apps so I would not know, however in order to try and please everybody I have added a couple of options with regard to this function as follows:

1. You can select it from the patcher and it will be installed permenantly
2. You can deselect it from the patcher and it will not be installed
   in this instance you then have the following options:
   
a. You can enable the SDR patch by calling W32Dasm with the commandline
   parameter 'VBOn'.
   This patches w32dasm live in memory and the patch will only be functional for
   this instance of w32dasm.
   
   You can still call a program from the commandline also but the VBOn switch
   must be the last parameter eg:
   
   w32dsm89.exe c:\mycrappyvbapp.exe VBOn

b. Calling w32dasm without the VBOn switch does not patch in the SDR enabler and
   your programs will disassemble normally.
   
Now instead of having two copies of w32dasm you can instead just have two shortcuts one with VB and one without.
Of course this option only works if you have the commandline option installed.
You also need to update your w32patch.dll with this new one obviously!!!
For those of you that are insterested in how this was achieved see the code snippet at the end of this file.



Although you have choices in the functions installed now, the patcher is designed as a one off patcher. In other words you should not patch some functions then go back later and try patching in a few more into the same file. While many combinations will work this way some won't and you could run into problems. It is better to always patch a new W32Dasm.

I have left the 'Disable version checks' option in. This does allow some flexibility on repatching. The version check simply checks the bytes at offset 000FBED0H. However after the 'Commandline n Recent' and 'Permenant Patcher' patches the resource section is completely altered and this value is not found at the above location. Disabling simply overides this check. 

There is no option for uninstalling the functions either. Although this is possible the patcher is already at 256kb unpacked any more and MicroBloat will be ringing me with job offers ;-)

For those of you with other wierd and wonderful operating systems, tough! 

Thanks to those people who were good enough to write to me and let me know of the win2k problem. It was a lot of hard work to produce this patcher so I hope it works :-)
For those idiots who insist on writting 'Amazing Patcher. Where do I get w32dasm? and what does it do?' type mail:

GET STUFFED!!!!!!
Go buy yourself a Gameboy or something!


Any other (w32Dasm disassembled related) problems please let me know I will be glad to try and help but please try to include as much information in your mail as possible. I cannot do much if you just write 'W32Dasm disassembled doesn't work plz help!' its like me writting to to you and saying 'My car rattles, plz help!'


Enjoy.


Harlequin



Snippet########################################

The below was added to the w32patch.dll code. I have left a couple of lines either side of the added code so that you will know where it was added.


commandline: 
    mov      byte ptr[edi-1],00    ; isolate parameter from commandline
    dec      ecx                        
    mov      esi,edi               ; copy of edi (commandline parameter)

;########## added
    
    mov      temp,ecx              ; save a copy of ecx as lstrcmpia changes it
    add      esi,ecx               ; point esi to the end of the paramaters
    sub      esi,4                 ; move esi back 4 chars
    .if      byte ptr[esi-1]==20h  ; if there is a file param seperate
             mov byte ptr[esi-1],00     ; the VBOn param from it
    .endif
    invoke   lstrcmpiA,esi,offset VBOn  ; If we want to enable Dreads vb patch
    .if      eax == 0
             mov    eax,0041756Ch       ; Patch it in
             mov    dword ptr[eax],0FFFFF498h
             .if temp==4                ; if it was the only param
               jmp    No_commandline    ; Lets leave 
             .else 
               sub temp,4         ; if not correct the param length and continue
             .endif  
    .endif
    
    mov      ecx,temp                   ; restore ecx
    mov      esi,edi                    ; and esi

;######### end added

    add      edi,ecx                    ; point edi to end of parameter
    mov      temp,ecx                   ; Save parameter length 
    std                                 ; set direction flag to decrement
    mov      al,5Ch                     ; put '\' char in al
    repnz    scasb                      ; Search '\' in param from end to front
